package com.yellowpage.white.common;

import java.net.URL;

import org.apache.commons.configuration.Configuration;
import org.apache.commons.configuration.ConfigurationFactory;

public class Constants {
	private static final Constants constants = new Constants();
	private static Configuration config;
	
	private Constants(){
		try {
			// Configure Factory
			ConfigurationFactory factory = new ConfigurationFactory();			
			URL configURL = this.getClass().getResource("/constants.xml");
			
			factory.setConfigurationURL(configURL);

			config = factory.getConfiguration();
			
			System.out.println("Configure Factory init :" + config);		
			
		} catch (Exception e) {
			e.printStackTrace();
		}
	}

	
	public static String get(String constantsName){
		return config.getString(constantsName);
	}
	
	public static void main(String[] args){
		//Constants s = new Constants();
		System.out.println("sdas:" + Constants.get("ALARMINFO_STATUS_INIT"));		
	}


	
}